﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Projeto
{
    public partial class FormConsultaColaborador : Form
    {
        private PoolConexoes conexoes = new PoolConexoes();

        public FormConsultaColaborador()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            buscarColaborador();
        }

        private void buscarColaborador()
        {

            ArrayList array = conexoes.getColaborador(textBoxCodColaborador.Text, textBoxNome.Text);

            if (array.Count > 0)
            {
                dataGridViewColaborador.DataSource = array;
            }
            else
            {
                MessageBox.Show("Nenhum Colaborador cadastrado.");
            }

        }

        private void dataGridViewColaborador_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }
    }
}
